const sq = require('./index');
const { DataTypes } = require('sequelize');
const userFriendMid = sq.define('userFriendMid', {
    friendUserId1: {
        type: DataTypes.INTEGER,
        allowNull: false,
        comment: "用户的好友1的id的值,表示好友1向好友2发送的请求"
    },
    friendUserId2: {
        type: DataTypes.INTEGER,
        allowNull: false,
        comment: "用户的好友2的id的值,表示好友2接受好友1"
    },
    commendName1: {
        type: DataTypes.STRING,
        comment: "好友1向给好友2的备注名字"
    },
    commendName2: {
        type: DataTypes.STRING,
        comment: "好友2向给好友1的备注名字"
    },
    friendsTypes: {
        type: DataTypes.INTEGER,
        allowNull: false,
        comment: "关系的类型 0零时聊天 1好友关系"
    },
    friendMessageId: {
        type: DataTypes.STRING,
        comment: "当前好友的聊天信息的索引列，确定那两个用户是好友的聊天表"
    },
    showMessage1: {
        type: DataTypes.BOOLEAN,
        comment: "好友1是否展示此聊天"
    },
    showMessage2: {
        type: DataTypes.BOOLEAN,
        comment: "好友2是否展示此聊天"
    },
    noMessageNum1: {
        type: DataTypes.INTEGER,
        comment: "好友1未读消息的数量"
    },
    noMessageNum2: {
        type: DataTypes.INTEGER,
        comment: "好友2未读消息的数量"
    },
    messageLastdate: {
        type: DataTypes.INTEGER,
        comment: "上次聊天的id"
    }
}, {
    freezeTableName: true,
});
//userFriendMid.sync({ force: true })
module.exports = userFriendMid;